<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="http://www.springframework.org/schema/beans 
                           http://www.springframework.org/schema/beans/spring-beans.xsd
                           http://www.springframework.org/schema/context 
                           http://www.springframework.org/schema/context/spring-context.xsd">

	<!-- ******************* -->
	<!-- Hibernate -->
	<!-- ******************* -->

	<bean id="hibernateSessionFactory"
		class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
		<property name="dataSource" ref="dataSource" />
		<property name="annotatedClasses">
			<list>
				<value>de.fhd.pms.model.Action</value>
				<value>de.fhd.pms.model.Tour</value>
				<value>de.fhd.pms.model.User</value>
				<value>de.fhd.pms.model.UsersTour</value>
			</list>
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
				<prop key="hibernate.hbm2ddl.auto">update</prop>
				<prop key="hibernate.show_sql">true</prop>
				<prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
			</props>
		</property>
	</bean>

	<bean id="transactionManager"
		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
		<property name="sessionFactory" ref="hibernateSessionFactory" />
	</bean>

	<!-- ******************* -->
	<!-- Data Access Objects -->
	<!-- ******************* -->

	<bean id="userDao" class="de.fhd.pms.dao.UserDao">
		<property name="sessionFactory" ref="hibernateSessionFactory" />
	</bean>

	<bean id="actionDao" class="de.fhd.pms.dao.ActionDao">
		<property name="sessionFactory" ref="hibernateSessionFactory" />
		<property name="userDao" ref="userDao" />
	</bean>

	<bean id="tourDao" class="de.fhd.pms.dao.TourDao">
		<property name="sessionFactory" ref="hibernateSessionFactory" />
		<property name="userDao" ref="userDao" />
		<property name="actionDao" ref="actionDao" />
	</bean>
	<bean id="usersTourDao" class="de.fhd.pms.dao.UsersTourDao">
		<property name="sessionFactory" ref="hibernateSessionFactory" />
	  	<property name="userDao" ref="userDao" />
		<property name="tourDao" ref="tourDao"/>
		<property name="actionDao" ref="actionDao"/>
	</bean>

</beans>